# Maintainer: Ben Westover <kwestover.kw@gmail.com>

pkgname=mtkclient
pkgver=1.52
pkgrel=0
pkgdesc="Unofficial MTK reverse engineering and flash tool"
url="https://github.com/bkerler/mtkclient"
arch="noarch"
license="MIT"
depends="libusb android-udev-rules python3 py3-usb py3-pycryptodome py3-colorama"
makedepends="py3-setuptools"
options="!check" # No tests available
source="
	$pkgname-$pkgver.tar.gz::https://github.com/bkerler/mtkclient/archive/refs/tags/$pkgver.tar.gz
	data.patch
"

build() {
	python3 setup.py build
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	install -Dm644 Setup/Linux/51-edl.rules "$pkgdir"/etc/udev/rules.d/52-edl.rules
}

sha512sums="
d8a5d6ff8a710b2b9f551b69735494b11b412bb6ad16d023513628c60eea2e49a73956a7b5b43891e6ac701aa752b97e622c4ef56596c91ef110afd8e94bface  mtkclient-1.52.tar.gz
f1a0059b9e48ca73cda1e3b327912f71b6fca1bc78f9f0252ac170ae81f82017fa7f64b58455fc8d5273ae68e4ccebde19550518b0ce9bed26b14486ac68cf09  data.patch
"
